package com.huluobo.a2204parkdemo.adapter

import android.view.View
import android.widget.ImageView
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.huluobo.a2204parkdemo.R
import com.huluobo.base.bean.RepairBeanItem

/**
 *  Created by LC on 2024/8/26.
 */
class RepairAdapter : BaseQuickAdapter<RepairBeanItem, BaseViewHolder>(R.layout.item_repair) {
    override fun convert(helper: BaseViewHolder, item: RepairBeanItem) {
        helper.setText(R.id.item_repair_desc_tv, item.repairDescribe)
        helper.setText(R.id.item_repair_time_tv, item.repairData)

        val selectImg = helper.getView<ImageView>(R.id.item_repair_select_iv)
        if (item.isShow) {
            selectImg.visibility = View.VISIBLE
        } else {
            selectImg.visibility = View.GONE
        }

        if (item.isSelected) {
            selectImg.setImageResource(R.drawable.gou)
        } else {
            selectImg.setImageResource(R.drawable.gou_default)
        }
    }
}